unit GameClassUnit;

interface

uses
  Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
  Dialogs, DBClient, DB, ADODB, StdCtrls, Buttons, Grids, DBGrids;

type
  TfrmGameClass = class(TForm)
    dgGameGroup: TDBGrid;
    btnAdd: TBitBtn;
    btnDel: TBitBtn;
    btnEdit: TBitBtn;
    BitBtn4: TBitBtn;
    BitBtn5: TBitBtn;
    QueryGameClass: TADOQuery;
    dsGameClass: TDataSource;
    QueryGameClassGameClassId: TIntegerField;
    QueryGameClassGameClassName: TStringField;
    QueryGameClassGameClassMemo: TStringField;
    QueryGameClassGameGroupId: TIntegerField;
    QueryGameGroup: TADOQuery;
    QueryGameGroupGameGroupId: TIntegerField;
    QueryGameGroupGameGroupName: TStringField;
    QueryGameClassGameGroupName: TStringField;
    procedure FormCreate(Sender: TObject);
    procedure btnAddClick(Sender: TObject);
    procedure btnEditClick(Sender: TObject);
    procedure btnDelClick(Sender: TObject);
    procedure BitBtn4Click(Sender: TObject);
    procedure BitBtn5Click(Sender: TObject);
  private
    { Private declarations }
  public
    { Public declarations }
  end;

var
  frmGameClass: TfrmGameClass;

implementation

uses FunctionUnit, GTMain;

{$R *.dfm}

procedure TfrmGameClass.FormCreate(Sender: TObject);
begin
  OpenDataSet('SELECT GameGroupId, GameGroupName FROM GameGroup', QueryGameGroup, Database);
  OpenDataSet('SELECT * FROM GameClass', QueryGameClass, Database);

end;

procedure TfrmGameClass.btnAddClick(Sender: TObject);
begin
  QueryGameClass.Append;
end;

procedure TfrmGameClass.btnEditClick(Sender: TObject);
begin
  QueryGameClass.Edit;
end;

procedure TfrmGameClass.btnDelClick(Sender: TObject);
begin
  QueryGameClass.Delete;
end;

procedure TfrmGameClass.BitBtn4Click(Sender: TObject);
begin
  QueryGameClass.CheckBrowseMode;
  Close;
end;

procedure TfrmGameClass.BitBtn5Click(Sender: TObject);
begin
  Close;
end;

end.
